package day02;

import javax.xml.ws.Holder;
import java.io.Serializable;

public class Emp implements Serializable {
    private Integer id;
    private String name;
    private Double salary;
    private String sex;
    private String edu;
    private String[] hobbies;
    private String description;

    public static final String HOBBIES_SPLIT=",";

    public Emp() {
    }


    public String getHob(){
        if(hobbies!=null){
            return String .join(HOBBIES_SPLIT,hobbies);
        }
        return null;
    }

    public void setHob(String hob){
        if(hob!=null){
            hobbies=hob.split(HOBBIES_SPLIT);
        }
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getSalary() {
        return salary;
    }

    public void setSalary(Double salary) {
        this.salary = salary;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getEdu() {
        return edu;
    }

    public void setEdu(String edu) {
        this.edu = edu;
    }

    public String[] getHobbies() {
        return hobbies;
    }

    public void setHobbies(String[] hobbies) {
        this.hobbies = hobbies;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
